const express = require('express');
var app = express();
app.listen(3000);
//1.初始化计数器
var counter = 0;
//2.每访问/user，执行counter加1
app.use('/user',(req,res,next)=>{
  counter++;
  next();
});
//3.把counter计算的结果发送到客户端
app.get('/user',(req,res,next)=>{
  //res.send('this is user page');
  res.send(counter.toString());
});